<template>
	<view class="container">
		<view class="content">
			<image class="docterImg" :src="docter.avatar"></image>
			<view class="right-aside">
				<view class="name">
					{{docter.nickname}}
					<text class="jjtips">
					{{docter.userRank=="1"?"实习医生":docter.userRank=="2"?"主治医生":docter.userRank=="3"?"主任医生":"其他医生"}}
					</text>
				</view>
				<text class="tips">
				{{docter.introduction}} --- {{docter.userRank=="1"?"实习医生":docter.userRank=="2"?"主治医生":docter.userRank=="3"?"主任医生":"其他医生"}}
				</text>
				<view class="btn">
					<view class="btn-item" @click="goDiagnose">预约</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserById
	} from '../../api/user/index.js'
	export default {
		data() {
			return {
				docter: {}
			}
		},
		async onLoad(options) {
			getUserById(options.id).then(res => {
				this.docter=res.data
				uni.setStorageSync('docter',res.data)
			})
		},
		methods: {
			goDiagnose(){
				uni.navigateTo({
					url: `/pages/docter/diagnose?id=${this.docter.id}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.container{
		width: 100%;
		height: 100vh;
		background-size: 100% 100%;
		background-color: #F8F8F8;
		padding-top: 15px;
	}
	.content{
		background-color: white;
		height: 150px;
		width: 100%;
	}
	.name{
		font-size: 20px;
		font-weight: 600;
		width: 200px;
		height: 40px;
	}
	.tips{
		font-size: 15px;
		font-weight: 400;
		color: #999999;
	}
	.jjtips{
		font-size: 15px;
		font-weight: 400;
		color: #999999;
		margin-left: 10px;
	}
	page {
		.docterImg{
			margin: 25px 10px;
			width: 100px;
			height: 100px;
		}
		.right-aside{
			width: 270px;
			height: 120px;
			display: flex;
			float: right;
			// justify-content: space-around;
			flex-direction: column;
			margin-top: 20px;
			padding-left: 10px;
		}
		.btn{
			width: 70px;
			height: 30px;
			border-radius: 5px;
			background-color: #60B3F9;
			text-align: center;
			line-height: 30px;
			color: white;
			font-size: 15px;
			font-weight: 600;
			margin-top: 15px;
		}
	}
</style>